package com.hxzy.framework.common.resp;

/**
 * @Author wxy
 * @Date 2020/9/22 11:46
 * @Version 1.0
 */
public enum ResultCode implements IErrorCode {
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    UNAUTHORIZED(401, "暂未登录或伪token"),
    FORBIDDEN(403, "token已失效或伪token"),
    DATA_NOT_FOUND(404,"查询不到数据"),
    DEMOTION(-1, "熔断降级"),
    CALLBACK(0,"回调成功"),
    MERCHANTID_NOT_NULL(400,"商家ID不能为空"),
    MISSING_REQUEST_PARAM_ERROR(400,"参数缺失");
    ;

    private final int code;
    private final String message;

    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
